package example.dao;

import example.dao.provider.UserInfoDynaSqlProvider;
import example.pojo.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface UserInfoDao {
    //获取系统合法用户status=1
    @Select("select * from user_info where status=1")
    public List<UserInfo>getValidUser();

    //根据客户id号获取客户对象
    @Select("select * from user_info where id=#{id}")
    public UserInfo getUserInfoById(int id);

    //
    @SelectProvider(type = UserInfoDynaSqlProvider.class, method = "selectWithParam")
    List<UserInfo> selectByPage(Map<String, Object> params);
    //
    @SelectProvider(type = UserInfoDynaSqlProvider.class,method = "count")
    Integer count(Map<String,Object>params);

    //
    @Update("update user_into set status=#{falg} where id in (${id})")
    void updateState(@Param("ids") String ids,@Param("flag") int flag);


}
